package com.clannad.eduorder.schedule;

import com.clannad.eduorder.service.OrderService;
import com.clannad.eduorder.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class ScheduledTask {
    @Autowired
    private OrderService service;

    @Scheduled(cron="0 0 1 * * ?")
    //删除未支付的订单
    public void task(){
        service.deleteStatusByZero();
    }
}
